Microcontrollers are systems on a chip including a microprocessor, memory, oscillators and a plurality of peripheral devices. There are many microcontrollers available that practically do not require any external component to allow the microcontroller to function. The variety of peripherals integrated within a microcontroller need to be synchronized to a timebase. A timebase provides, for example, internal clock signals used by the peripherals. The timebase peripheral in a typical microcontroller has Input Capture and Output Compare modes. Typically, the timebase peripheral only generates synchronization/trigger events associated with the timebase period rollover as shown in FIG. 1. For example, in a microcontroller, a conventional 16-bit timebase peripheral 100 may have an external sync and trigger ability as shown in FIG. 1. In a Sync Mode, the signal sets a timebase period and in a trigger Mode, the signal starts a timebase, wherein a timebase period is derived from an internal register. The sync mode lets many timebases operate in parallel and the trigger mode allows delayed operation, for example, the timer is held in reset until a trigger is received. In these conventional embodiments, the sync/trigger output is the period match or rollover signal from timebase and is sent to all other timebases on the device as shown in FIG. 1.
A plurality of sync/trigger signals 170 are fed to a multiplexer 120. One of the input signals can be the output signal of comparator 140. The selected signal is fed to a sync and trigger control unit 130 which controls operation of a 16/32 bit timebase counter 110. Comparator 140 receives the count value from timebase counter 110 and the value of a period register 150 and generates a sync/trigger output signal 160 which can be fed to other peripheral devices.